{% extends "base/admin_micro.html" %}

{% block title %}第三方插件系统静态资源上传{% endblock %}


{% block head %}
    <link href="/static/admin/css/plugins/dropzone/basic.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/dropzone/dropzone.css" rel="stylesheet">
{% endblock %}


{% block content %}
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>第三方插件系统静态资源上传</h5>
                        <div class="ibox-tools">
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form id="my-awesome-dropzone" class="dropzone" action="form_file_upload.html#">
                            <div class="dropzone-previews"></div>
                            <button type="submit" class="btn btn-primary pull-right">提交</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>

{% endblock %}


{% block script %}
    <!-- DROPZONE -->
    <script src="/static/admin/js/plugins/dropzone/dropzone.js"></script>

    <script>
        $(document).ready(function () {

            Dropzone.options.myAwesomeDropzone = {

                autoProcessQueue: false,
                uploadMultiple: true,
                parallelUploads: 100,
                maxFiles: 100,

                // Dropzone settings
                init: function () {
                    var myDropzone = this;

                    this.element.querySelector("button[type=submit]").addEventListener("click", function (e) {
                        e.preventDefault();
                        e.stopPropagation();
                        myDropzone.processQueue();
                    });
                    this.on("sendingmultiple", function () {});
                    this.on("successmultiple", function (files, response) {});
                    this.on("errormultiple", function (files, response) {});
                }

            }

        });
    </script>

{% endblock %}